package com.example.interceptor.custom_method_interceptor;


import com.example.interceptor.custom_method_interceptor.annotation.LhwInterceptor;
import com.example.interceptor.custom_method_interceptor.interceptor.CustomInterceptor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.aop.Advisor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description 自定义方法拦截器配置
 * @Author lihw
 * @Date 2023/12/5 10:59
 */
@Slf4j
@Configuration
public class MethodInterceptorConfig {

    @Bean
    public Advisor customAnnotationAdvisor() {
        CustomInterceptor customInterceptor = new CustomInterceptor();
        CustomAnnotationAdvisor customAnnotationAdvisor = new CustomAnnotationAdvisor(customInterceptor, LhwInterceptor.class);
        return customAnnotationAdvisor;
    }
}
